//
//  ZhiFuHuaFeiView.m
//  GuoBang
//
//  Created by 冯帅 on 16/5/11.
//  Copyright © 2016年 梧桐树. All rights reserved.
//

#import "ZhiFuHuaFeiView.h"

@implementation ZhiFuHuaFeiView



-(instancetype)initWithFrame:(CGRect)frame
{
    
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];

        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width / 2 - 50, 3, 100, 12)];
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        self.titleLabel.textColor = RGBCOLOR(144, 144, 144);
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.text = @"订单已支付";
        [self addSubview:self.titleLabel];
        
        
        self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 7, 50, 12)];
        self.priceLabel.font = [UIFont systemFontOfSize:12];
        self.priceLabel.textColor = RGBCOLOR(69, 69, 69);
        self.priceLabel.text = @"价格";
        [self addSubview:self.priceLabel];
        
        
        self.youhuiLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.priceLabel.frame) + 7, CGRectGetWidth(self.priceLabel.frame), CGRectGetHeight(self.priceLabel.frame))];
        self.youhuiLabel.font = [UIFont systemFontOfSize:12];
        self.youhuiLabel.textColor = RGBCOLOR(69, 69, 69);
        self.youhuiLabel.text = @"优惠金额";
        [self addSubview:self.youhuiLabel];
        
        
        self.shijiLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.youhuiLabel.frame) + 7, CGRectGetWidth(self.priceLabel.frame), CGRectGetHeight(self.priceLabel.frame))];
        self.shijiLabel.font = [UIFont systemFontOfSize:12];
        self.shijiLabel.textColor = RGBCOLOR(69, 69, 69);
        self.shijiLabel.text = @"实际支付";
        [self addSubview:self.shijiLabel];

        self.lineView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.shijiLabel.frame) + 11, self.frame.size.width, 1)];
        
        self.lineView.backgroundColor = RGBCOLOR(211, 211, 211);
        [self addSubview:self.lineView];
        
        
        self.priceMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width - 110, 7, 100, 12)];
        self.priceMoneyLabel.font = [UIFont systemFontOfSize:12];
        self.priceMoneyLabel.textColor = RGBCOLOR(69, 69, 69);
        self.priceMoneyLabel.text = @"100";
        self.priceMoneyLabel.textAlignment = NSTextAlignmentRight;
        [self addSubview:self.priceMoneyLabel];
        
        
        self.youhuiMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.priceMoneyLabel.frame), CGRectGetMinY(self.youhuiLabel.frame), 100, 12)];
        self.youhuiMoneyLabel.font = [UIFont systemFontOfSize:12];
        self.youhuiMoneyLabel.textColor = RGBCOLOR(69, 69, 69);
        self.youhuiMoneyLabel.text = @"-0.19";
        self.youhuiMoneyLabel.textAlignment = NSTextAlignmentRight;
        [self addSubview:self.youhuiMoneyLabel];
        
        
        self.shijiMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.priceMoneyLabel.frame), CGRectGetMinY(self.shijiLabel.frame), 100, 12)];
        self.shijiMoneyLabel.font = [UIFont systemFontOfSize:12];
        self.shijiMoneyLabel.textColor = RGBCOLOR(255, 109, 109);;
        self.shijiMoneyLabel.text = @"99.81";
        self.shijiMoneyLabel.textAlignment = NSTextAlignmentRight;
        [self addSubview:self.shijiMoneyLabel];

        
        
        self.pingjiaBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        self.pingjiaBtn.frame = CGRectMake(0, CGRectGetMaxY(self.lineView.frame), self.frame.size.width / 2, 22);
        [self.pingjiaBtn setTitle:@"评价订单" forState:UIControlStateNormal];
        [self.pingjiaBtn setTitleColor:RGBCOLOR(69, 69, 69) forState:UIControlStateNormal];
        self.pingjiaBtn.titleLabel.font = [UIFont systemFontOfSize:12];
        [self.pingjiaBtn setImage:[UIImage imageNamed:@"order_ico_appraise.png"] forState:UIControlStateNormal];
        [self.pingjiaBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 20, 0, 0)];
        [self.pingjiaBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 20)];
        [self addSubview:self.pingjiaBtn];
        
        
        
        self.shareBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        self.shareBtn.frame = CGRectMake(self.frame.size.width / 2, CGRectGetMaxY(self.lineView.frame), self.frame.size.width / 2, 22);
        [self.shareBtn setTitle:@"分享订单" forState:UIControlStateNormal];
        [self.shareBtn setImage:[UIImage imageNamed:@"order_ico_share.png"] forState:UIControlStateNormal];
        [self.shareBtn setTitleColor:RGBCOLOR(69, 69, 69) forState:UIControlStateNormal];
        self.shareBtn.titleLabel.font = [UIFont systemFontOfSize:12];
        [self.shareBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 20, 0, 0)];
        [self.shareBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 20)];
        [self addSubview:self.shareBtn];
        
        
    }
    
    return self;
    
    
    
    
}



- (id)initWithFrame:(CGRect)frame withprice:(NSString *)price youhui:(NSString *)youhui zhifu:(NSString *)zhifu
{
    
    
    self = [self initWithFrame:frame];
    if (self) {
        

        self.priceMoneyLabel.text = price;
        self.youhuiMoneyLabel.text = youhui;
        self.shijiMoneyLabel.text = zhifu;
        
    }
    
    return self;
    
    
}












@end
